#ifndef __DEFINE_G_H__
#define __DEFINE_G_H__

//System includes
#include <stdio.h>

////OpenGLES include
//#include <GLES2\gl2.h>

//Release buffer memory
#define SAFE_DEL(p)						if(p){delete p; p = NULL;}
#define SAFE_DEL_ARRAY(pa)				if(pa){delete[] pa; pa = NULL;}
#define SAFE_DEL_ARRAY_POINTER(n,pap)	if(pap){for(int i=0; i<n; i++){if(pap[i]){delete pap[i]; pap[i] = NULL;}} delete[] pap; pap = NULL;}

//Define message call back function

//Call when game send START_GAME message
void CallBackStartDevice(const void *, void *);
//Call when game send END_GAME message
void CallBackEndDevice(const void *, void *);
//Call when game send DRAW message
//void CallBackDraw(const void *, void *);
//Call when state send CHANGE_STATE message
void CallBackInternalSwitch(const void *, void *);

//Define variable type
typedef unsigned char		FWubyte;
typedef signed char			FWbyte;
typedef unsigned short		FWushort;
typedef signed short		FWshort;
typedef	unsigned int		FWuint;
typedef signed int			FWint;
typedef unsigned long		FWulong;
typedef signed long			FWlong;
typedef unsigned long long	FWullong;
typedef signed long long	FWllong;

typedef	float				FWfloat;
typedef double				FWdouble;

typedef bool				FWboolean;

typedef void*				FWobject;

//Link list random rate
#define MAX_RAND	1000

#define MAX_LENGTH	256
//

//Keyboard structure
struct KeyBoard
{
	char key;
	FWboolean status;
};

struct Cursor
{
	FWfloat x;
	FWfloat y;
	FWboolean status;
};

////TAG ID DEFINE
//
////Start game tag id
//#define FW_START_GAME		0x000000
////End game tag id
//#define FW_END_GAME			0x000001
////Keyboard event tag id: has keyboard event
//#define	FW_KEYBOARD_EVENT	0x000002
//
////PLATFORM_SUPPORT
//#define FW_WIN32_GLES_20	0x00000F

#endif